<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 第一课时： let

        let a;
        let testNumber = 900;


        // 1. 变量不能重复声明
        let happy = 90;
        // let happy = 800;


        // 2. 块级作用域     全局，函数，eval
        // 代码出块，收回声明
        
        {
            let someOneName = "李华";
            console.log(someOneName);
        }
        // console.log(someOneName);//出块显示没找到

        //Uncaught ReferenceError: someOneName is not defined at let.html:29:21

        //3. 不存在变量提升

        console.log(song); //出现undefined 未定义
        var song = '歌手';
        console.log(star);
        let star = "明星"; //let.html:37 Uncaught ReferenceError: Cannot access 'star' before initialization at
                           //引用错误(红色)

    </script>
    
    
</body>
</html>